Skip to content

fix(search): wait for the source-created handler in the live setup test - #8227

Open
waleedlatif1 wants to merge 1 commit into
stagingfrom
fix/search-source-setup-test-race
Open

waleedlatif1 wants to merge 1 commit into
stagingfrom
fix/search-source-setup-test-race

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • search-source-setup.test.tsx "selects a newly added live service source before navigating to it" fails most runs on staging (4/5 locally), which currently fails Test (shard 2) on every PR
  • onCreated awaits the nuqs URL-state reset, which flushes asynchronously, before it starts the updateSearchIntegration mutation, so asserting the mutation right after the create onSuccess act raced the flush
  • The test now waits for the mutation the same way its sibling setup test already does (vi.waitFor with a 1ms interval); no component change

Type of Change

  • Bug fix

Testing

The test passes 10/10 locally (was failing 4/5); lint and check:audits pass.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

The live service-source test asserted updateSearchIntegration immediately
after the create onSuccess act, but onCreated awaits the nuqs URL-state
reset (which flushes asynchronously) before it starts the mutation, so the
assertion raced the flush and failed most runs. Wait for it the same way the
sibling setup test already does (vi.waitFor with a 1ms interval).
@vercel

vercel Bot commented Sep 24, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Sep 24, 2026 6:13am UTC

Request Review

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@greptile-apps

greptile-apps Bot commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge.

Summary

The PR replaces a synchronous mutation assertion with vi.waitFor to account for the asynchronous URL-state reset in the source-created handler.

  • No component behavior changes.
  • The source-selection and navigation assertions remain in place.

Reviews (1) · Last reviewed commit: "fix(search): wait for the source-created..."

This branch was previously deployed

1 inactive deployment
Preview d5dcc5ee Deployed Sep 24, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant